<link type="text/css" href="./tpl/css/jquery-ui.css" rel="stylesheet"/>
<link type="text/css" href="./tpl/css/jquery-ui-timepicker-addon.css"/>
<link type="text/css" href="./tpl/css/demos.css" rel="stylesheet"/>

<script type="text/javascript" src="./tpl/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="./tpl/js/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="./tpl/js/jquery.ui.datepicker-zh-CN.js.js" charset="gb2312"></script>
<script type="text/javascript" src="./tpl/js/jquery-ui-timepicker-zh-CN.js"></script>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>Connect Websocket</title>
<!--    <input type="text" name="ask" style="width: 400px"/>
    <input type="button" id="Send-Btn" value="发送"/>-->
    <script type="text/javascript">

        if ("WebSocket" in window) {
            console.log("您的浏览器支持 WebSocket!");
            var ws = new WebSocket("ws://localhost:8080");

            ws.onopen = function () {
                ws.send("hello server");
            };

            ws.onmessage = function (evt) {
                var received_msg = evt.data;
                console.log(received_msg);
            };

            ws.onclose = function () {
                console.log("连接已关闭...");
            };

        } else {
            alert("您的浏览器不支持 WebSocket!");
        }
/*        $(document).ready(function () {
            $('#Send-Btn').click(function () {
                ws.send($("input[name='ask']").val())

            });
        });*/
    </script>

</head>
<body></body>